package cn.bonoon.kernel.expression.results;

import org.batatasframework.web.RequestParameterReader;

import cn.bonoon.kernel.expression.ExpressionObject;
import cn.bonoon.kernel.expression.ExpressionParseContext;
import cn.bonoon.kernel.expression.ExpressionValue;
import cn.bonoon.kernel.support.IOperator;

/**
 * 这个类型将会直接从传过来的对象进行取值处理，主要运用于查询条件的查询对象
 * @author jackson
 *
 */
public class ObjectExpressionValue implements ExpressionValue, ExpressionObject{
	
	private final String propertyName;
	
	public ObjectExpressionValue(ExpressionParseContext context, String propertyName){
		this.propertyName = propertyName;
	}
	
	@Override
	public boolean checkName(String name){
		return propertyName.equals(name);
	}

	@Override
	public Object value(IOperator operator, RequestParameterReader parameterReader, Object defaultValue) {
		return defaultValue;
	}
}
